<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ page import="java.util.*" %>
<%@ page import="com.al.jsp_need.User" %>
<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>小练习</title>
	</head>
	<body>
	<!-- 做个小练习，进一步掌握 JSP -->
		<%
			List<User> list = new ArrayList<User>();
			list.add(new User("张三 ", 25));
			list.add(new User("李四", 22));
			list.add(new User("王五", 21));
		%>
		<table>
			<tr>
				<th>姓名</th>
				<th>年龄</th>
			</tr>
			<%
				for(int i = 0; i < list.size(); i++){
					%>
					<tr>
						<td><%=list.get(i).getName() %></td>
						<td><%=list.get(i).getAge() %></td>
					</tr>
					
					<% 
				}
			%>
					
		</table>
	</body>
</html>